Skip to content

Add container host to MQTT events #30

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docker2mqtt/docker2mqtt.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@ def __init__(self, cfg: Docker2MqttConfig, do_not_exit: bool = False):
{
"name": container_status["Names"],
"image": container_status["Image"],
"host": cfg['docker2mqtt_hostname'],
"status": status_str,
"state": state_str,
}
Expand Down
3 changes: 3 additions & 0 deletions docker2mqtt/type_definitions.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ class ContainerEvent(TypedDict):
The name of the container
image
The image the container is running
host
The host the container is running on
status
The docker status the container is in
state
Expand All @@ -91,6 +93,7 @@ class ContainerEvent(TypedDict):

name: str
image: str
host: str
status: ContainerEventStatusType
state: ContainerEventStateType

Expand Down
Loading