Skip to content

Commit

Permalink
bug: fix startup issues (#40)
Browse files Browse the repository at this point in the history
* bug: fix startup issues

Better handle errors when plugin is starting and the mixer is not available.
Update some text
require new version of behringer_mixer.py

* bump version
  • Loading branch information
wrodie authored Mar 15, 2024
1 parent 4743f53 commit 596d045
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 12 deletions.
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,5 +82,4 @@ If you want to contribute to this please read the [Contribution guidelines](CONT
[hacsbadge]: https://img.shields.io/badge/HACS-Custom-orange.svg?style=for-the-badge
[releases-shield]: https://img.shields.io/github/release/wrodie/ha_behringer_mixer.svg?style=for-the-badge
[releases]: https://github.com/wrodie/ha_behringer_mixer/releases
[integration_blueprint]: https://github.com/ludeeus/integration_blueprint
[license-shield]: https://img.shields.io/github/license/ludeeus/integration_blueprint.svg?style=for-the-badge
[license-shield]: https://img.shields.io/github/license/wrodie/ha_behringer_mixer.svg?style=for-the-badge
12 changes: 10 additions & 2 deletions config/configuration.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
# https://www.home-assistant.io/integrations/default_config/

# Loads default set of integrations. Do not remove.
default_config:

# https://www.home-assistant.io/integrations/logger/
logger:
default: info
logs:
custom_components.ha_behringer_mixer: debug

# Load frontend themes from the themes folder
frontend:
themes: !include_dir_merge_named themes

automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml
2 changes: 1 addition & 1 deletion custom_components/ha_behringer_mixer/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ async def load_scene(self, scene_number):

def new_data_callback(self, data: dict):
"""Handle the callback indicating new data has been received."""
if data.get("property").endswith("_db"):
if data and data.get("property") and data.get("property").endswith("_db"):
return True
if self.coordinator:
self.coordinator.async_set_updated_data(self._get_data())
Expand Down
2 changes: 1 addition & 1 deletion custom_components/ha_behringer_mixer/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
NAME = "Behringer Mixer"
DOMAIN = "ha_behringer_mixer"
VERSION = "0.1.1"
ATTRIBUTION = "Data provided by http://jsonplaceholder.typicode.com/"
ATTRIBUTION = ""
4 changes: 2 additions & 2 deletions custom_components/ha_behringer_mixer/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"iot_class": "local_push",
"issue_tracker": "https://github.com/wrodie/ha_behringer_mixer/issues",
"requirements": [
"behringer-mixer==0.4.3"
"behringer-mixer==0.4.4"
],
"version": "0.1.7"
"version": "0.1.8"
}
4 changes: 3 additions & 1 deletion custom_components/ha_behringer_mixer/select.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,6 @@ async def async_select_option(self, option: str) -> None:
@property
def current_option(self) -> str | None:
"""Return the current option."""
return self.coordinator.data[self.base_address]
if self.base_address in self.coordinator.data:
return self.coordinator.data[self.base_address]
return None
6 changes: 3 additions & 3 deletions custom_components/ha_behringer_mixer/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
"MATRICES": "Matrices to import",
"AUXINS": "Aux ins to import",
"DCAS": "DCAs to import",
"MAIN": "Do you want to import the Main/LR Fader?",
"CHANNELSENDS": "Do you want to import Channel->Bus Sends?",
"BUSSENDS": "Do you want to import Bus->Matrix Sends?"
"MAIN": "Import the Main/LR Fader?",
"CHANNELSENDS": "Import Channel->Bus Sends?",
"BUSSENDS": "Import Bus->Matrix Sends?"
}
}
},
Expand Down

0 comments on commit 596d045

Please sign in to comment.