forked from platypush/platypush
s/disable_logging/logging_level/g on entity events.
This commit is contained in:
parent
3e41418742
commit
b044fa4acf
1 changed files with 7 additions and 8 deletions
|
@ -1,19 +1,15 @@
|
|||
from abc import ABC
|
||||
import logging
|
||||
from typing import Union
|
||||
|
||||
from platypush.entities import Entity
|
||||
from platypush.message.event import Event
|
||||
|
||||
|
||||
class EntityEvent(Event, ABC):
|
||||
def __init__(
|
||||
self, entity: Union[Entity, dict], *args, disable_logging=True, **kwargs
|
||||
):
|
||||
class EntityEvent(Event):
|
||||
def __init__(self, entity: Union[Entity, dict], *args, **kwargs):
|
||||
if isinstance(entity, Entity):
|
||||
entity = entity.to_json()
|
||||
super().__init__(
|
||||
entity=entity, *args, disable_logging=disable_logging, **kwargs
|
||||
)
|
||||
super().__init__(entity=entity, *args, **kwargs)
|
||||
|
||||
|
||||
class EntityUpdateEvent(EntityEvent):
|
||||
|
@ -22,6 +18,9 @@ class EntityUpdateEvent(EntityEvent):
|
|||
a sensor, a media player etc.) updates its state.
|
||||
"""
|
||||
|
||||
def __init__(self, *args, logging_level=logging.DEBUG, **kwargs):
|
||||
super().__init__(*args, logging_level=logging_level, **kwargs)
|
||||
|
||||
|
||||
class EntityDeleteEvent(EntityEvent):
|
||||
"""
|
||||
|
|
Loading…
Reference in a new issue