From 40d8e1c175fe6b5e8bf8b2d4612ea3056058c9f8 Mon Sep 17 00:00:00 2001 From: Marcel Date: Thu, 11 Nov 2021 23:10:47 +0100 Subject: [PATCH] [miio] Initial i18n properties file for Xiaomi miio binding (#11563) * [miio] Initial i18n properties file Signed-off-by: Marcel Verpaalen * [miio] add status msg to i18n Signed-off-by: Marcel Verpaalen --- .../internal/handler/MiIoAbstractHandler.java | 8 +- .../main/resources/OH-INF/binding/binding.xml | 2 +- .../main/resources/OH-INF/config/config.xml | 2 +- .../resources/OH-INF/i18n/miio.properties | 161 ++++++++++++++++++ 4 files changed, 167 insertions(+), 6 deletions(-) create mode 100644 bundles/org.openhab.binding.miio/src/main/resources/OH-INF/i18n/miio.properties diff --git a/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/handler/MiIoAbstractHandler.java b/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/handler/MiIoAbstractHandler.java index f2034f0eb..dd8aaa923 100644 --- a/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/handler/MiIoAbstractHandler.java +++ b/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/handler/MiIoAbstractHandler.java @@ -150,12 +150,12 @@ public abstract class MiIoAbstractHandler extends BaseThingHandler implements Mi final MiIoBindingConfiguration configuration = getConfigAs(MiIoBindingConfiguration.class); this.configuration = configuration; if (configuration.host.isEmpty()) { - updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR, - "IP address required. Configure IP address"); + updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR, "@text/offline.config-error-ip"); return; } if (!tokenCheckPass(configuration.token)) { - updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR, "Token required. Configure token"); + updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR, + "@text/offline.config-error-token"); return; } this.cloudServer = configuration.cloudServer; @@ -395,7 +395,7 @@ public abstract class MiIoAbstractHandler extends BaseThingHandler implements Mi } if (deviceId.isBlank() && !getCloudServer().isBlank()) { updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.OFFLINE.CONFIGURATION_ERROR, - "Cloud communication requires defined deviceId in the config"); + "@text/offline.config-error-cloud"); return null; } if (deviceId.length() == 8 && deviceId.matches("^.*[a-zA-Z]+.*$")) { diff --git a/bundles/org.openhab.binding.miio/src/main/resources/OH-INF/binding/binding.xml b/bundles/org.openhab.binding.miio/src/main/resources/OH-INF/binding/binding.xml index 3eaad8d93..4dc760120 100644 --- a/bundles/org.openhab.binding.miio/src/main/resources/OH-INF/binding/binding.xml +++ b/bundles/org.openhab.binding.miio/src/main/resources/OH-INF/binding/binding.xml @@ -3,7 +3,7 @@ xmlns:binding="https://openhab.org/schemas/binding/v1.0.0" xsi:schemaLocation="https://openhab.org/schemas/binding/v1.0.0 https://openhab.org/schemas/binding-1.0.0.xsd"> Xiaomi Mi IO Binding - Binding for Xiaomi Mi IO devices like Mi Robot Vacuum + Binding for Xiaomi Mi IO (Wifi) devices like Mi Robot Vacuum, Yeelights, Humidifiers, Fans etc. diff --git a/bundles/org.openhab.binding.miio/src/main/resources/OH-INF/config/config.xml b/bundles/org.openhab.binding.miio/src/main/resources/OH-INF/config/config.xml index 6a099e998..cc1e299d3 100644 --- a/bundles/org.openhab.binding.miio/src/main/resources/OH-INF/config/config.xml +++ b/bundles/org.openhab.binding.miio/src/main/resources/OH-INF/config/config.xml @@ -15,7 +15,7 @@ - Device ID number for communication (in Hex) + Device ID number for communication true diff --git a/bundles/org.openhab.binding.miio/src/main/resources/OH-INF/i18n/miio.properties b/bundles/org.openhab.binding.miio/src/main/resources/OH-INF/i18n/miio.properties new file mode 100644 index 000000000..cebf94f06 --- /dev/null +++ b/bundles/org.openhab.binding.miio/src/main/resources/OH-INF/i18n/miio.properties @@ -0,0 +1,161 @@ +# binding + +binding.miio.name = Xiaomi Mi IO Binding +binding.miio.description = Binding for Xiaomi Mi IO (Wifi) devices like Mi Robot Vacuum, Yeelights, Humidifiers, Fans etc. + +# binding config + +binding.config.miio.cloudDiscoveryMode.label = Cloud Discovery Mode +binding.config.miio.cloudDiscoveryMode.description = Allow for discovery via the cloud. This may be used for devices that are not on the same network as OpenHAB server +binding.config.miio.cloudDiscoveryMode.option.disabled = Local discovery only (Default) +binding.config.miio.cloudDiscoveryMode.option.supportedOnly = Discover online supported devices from Xiaomi cloud +binding.config.miio.cloudDiscoveryMode.option.all = Discover all online devices from Xiaomi cloud +binding.config.miio.country.label = Xiaomi server country +binding.config.miio.country.description = Xiaomi server country(s) (e.g. sg,de). Separate multiple servers with comma. Leave empty for all. See binding readme for country to server mapping +binding.config.miio.password.label = Xiaomi cloud password +binding.config.miio.username.label = Xiaomi cloud username +binding.config.miio.username.description = Xiaomi cloud username. Typically your email + +# thing types + +thing-type.miio.basic.label = Xiaomi Mi Basic Device +thing-type.miio.generic.label = Xiaomi Mi Device +thing-type.miio.unsupported.label = Unsupported Xiaomi Mi Device +thing-type.miio.vacuum.label = Xiaomi Robot Vacuum + +# thing types config + +thing-type.config.miio.config.cloudServer.label = Xiaomi cloud Server (county code) +thing-type.config.miio.config.communication.label = Communication Method +thing-type.config.miio.config.communication.description = Determines how the binding communicates with this device +thing-type.config.miio.config.communication.option.direct = Direct (Default) +thing-type.config.miio.config.communication.option.cloud = Cloud +thing-type.config.miio.config.deviceId.label = Device ID +thing-type.config.miio.config.deviceId.description = Device ID number for communication +thing-type.config.miio.config.host.label = IP Address +thing-type.config.miio.config.model.label = Device Model String +thing-type.config.miio.config.model.description = Device model string, used to determine the subtype. +thing-type.config.miio.config.refreshInterval.label = Refresh Interval +thing-type.config.miio.config.refreshInterval.description = Refresh interval for refreshing the data in seconds. (0=disabled) +thing-type.config.miio.config.timeout.label = Timeout +thing-type.config.miio.config.timeout.description = Timeout time in milliseconds +thing-type.config.miio.config.token.label = Token +thing-type.config.miio.config.token.description = Token for communication (in Hex) + +# channel group types + +channel-group-type.miio.actions.label = Action +channel-group-type.miio.basicactions.label = Actions +channel-group-type.miio.cleaning.label = Last Cleaning Details +channel-group-type.miio.consumables.label = Consumables +channel-group-type.miio.dnd.label = Do Not Disturb +channel-group-type.miio.history.label = History +channel-group-type.miio.info.label = Info +channel-group-type.miio.miioactions.label = Actions +channel-group-type.miio.network.label = Network +channel-group-type.miio.status.label = Status + +# channel types + +channel-type.miio.bssid.label = BSSID +channel-type.miio.carpet_mode.label = Carpet Mode +channel-type.miio.clean_area.label = Cleaning Area +channel-type.miio.clean_time.label = Cleaning Time +channel-type.miio.color.label = Generic Color Channel +channel-type.miio.commands.label = Execute Command +channel-type.miio.consumable_reset.label = Reset Consumable +channel-type.miio.consumable_reset.state.option.none = Select Consumable +channel-type.miio.consumable_reset.state.option.main_brush_work_time = Reset Mainbrush +channel-type.miio.consumable_reset.state.option.side_brush_work_time = Reset Sidebrush +channel-type.miio.consumable_reset.state.option.filter_work_time = Reset Filter +channel-type.miio.consumable_reset.state.option.sensor_dirty_time = Reset Sensors +channel-type.miio.contact.label = Generic Contact Channel +channel-type.miio.control.label = Control Vacuum +channel-type.miio.control.state.option.vacuum = Vacuum +channel-type.miio.control.state.option.spot = Spot Clean +channel-type.miio.control.state.option.pause = Pause +channel-type.miio.control.state.option.dock = Dock +channel-type.miio.customize_clean_mode.label = Customized Clean Mode +channel-type.miio.datetime.label = Generic DateTime Channel +channel-type.miio.dimmer.label = Generic Dimmer Channel +channel-type.miio.dnd_enabled.label = Do Not Disturb +channel-type.miio.dnd_end.label = End Time DND +channel-type.miio.dnd_function.label = Do Not Disturb Functionality +channel-type.miio.dnd_start.label = Start Time DND +channel-type.miio.error_code.label = Error Code +channel-type.miio.error_id.label = Error ID +channel-type.miio.fan.label = Control Fan Level +channel-type.miio.fan.state.option.38 = Silent +channel-type.miio.fan.state.option.60 = Standard +channel-type.miio.fan.state.option.75 = Turbo +channel-type.miio.fan.state.option.77 = Power +channel-type.miio.fan.state.option.90 = Full +channel-type.miio.fan.state.option.100 = Max +channel-type.miio.fan.state.option.101 = Quiet +channel-type.miio.fan.state.option.102 = Balanced +channel-type.miio.fan.state.option.103 = Turbov2 +channel-type.miio.fan.state.option.104 = Maxv2 +channel-type.miio.fan.state.option.105 = Mob +channel-type.miio.fan.state.option.-1 = Custom +channel-type.miio.fan_power.label = Fan Power +channel-type.miio.filter_percent.label = Filter Usage Remaining +channel-type.miio.filter_time.label = Filter Time till Replacement +channel-type.miio.fw_features.label = Firmware Features +channel-type.miio.image.label = Generic Image Channel +channel-type.miio.in_cleaning.label = In Cleaning +channel-type.miio.is_locating.label = Robot Locating +channel-type.miio.last_clean_area.label = Cleaning Area +channel-type.miio.last_clean_duration.label = Cleaning Duration +channel-type.miio.last_clean_end_time.label = Cleaning End +channel-type.miio.last_clean_end_time.description = Last Cleaning End Time +channel-type.miio.last_clean_error.label = Error +channel-type.miio.last_clean_finish.label = Cleaning Finished +channel-type.miio.last_clean_record.label = Cleaning Record +channel-type.miio.last_clean_start_time.label = Cleaning Start +channel-type.miio.last_clean_start_time.description = Last Cleaning Start Time +channel-type.miio.led_status.label = Led Status +channel-type.miio.life.label = Life +channel-type.miio.location.label = Generic Location Channel +channel-type.miio.lock_status.label = Lock Status +channel-type.miio.main_brush_percent.label = Main Brush Remaining +channel-type.miio.main_brush_time.label = Main Brush Time till Replacement +channel-type.miio.map.label = Cleaning Map +channel-type.miio.map_present.label = Map Present +channel-type.miio.map_status.label = Map Status +channel-type.miio.mop_forbidden_enable.label = Mop Forbidden +channel-type.miio.msg_seq.label = Msg Seq +channel-type.miio.multi_maps_list.label = Multi Map List +channel-type.miio.number.label = Generic Number Channel +channel-type.miio.player.label = Generic Player Channel +channel-type.miio.power.label = Power On/Off +channel-type.miio.rollershutter.label = Generic Rollershutter Channel +channel-type.miio.room_mapping.label = Room Mapping +channel-type.miio.rpc.label = Execute RPC (cloud) Command +channel-type.miio.rssi.label = RSSI +channel-type.miio.segment.label = Vacuum Room [room#] +channel-type.miio.segment_status.label = Segment Status +channel-type.miio.sensor_dirt_percent.label = Sensor Dirt Remaining +channel-type.miio.sensor_dirt_time.label = Sensor Dirt Time till Cleaning +channel-type.miio.side_brush_percent.label = Side Brush Remaining +channel-type.miio.side_brush_time.label = Side Brush Time till Replacement +channel-type.miio.ssid.label = SSID +channel-type.miio.state.label = State +channel-type.miio.state_id.label = State ID +channel-type.miio.string.label = Generic String Channel +channel-type.miio.switch.label = Generic Switch Channel +channel-type.miio.testcommands.label = (experimental)Execute test to find supported channels +channel-type.miio.testcommands.description = Execute test for all known properties to find channels supported by your device. Check your log, share your results. +channel-type.miio.testmiot.label = (experimental) Create experimental support for new MIOT protocol devices +channel-type.miio.testmiot.description = Create experimental support for MIOT protocol devices based on the online specification. Check your log, share your results. +channel-type.miio.total_clean_area.label = Total Cleaning Area +channel-type.miio.total_clean_count.label = Total Cleanings +channel-type.miio.total_clean_time.label = Total Cleaning Time +channel-type.miio.vacuum.label = Vacuum On/Off +channel-type.miio.water_box_carriage_status.label = Water Box Carriage State +channel-type.miio.water_box_mode.label = Water Box Mode +channel-type.miio.water_box_status.label = Water Box State + +# Thing status descriptions +offline.config-error-ip = IP address required. Configure IP address +offline.config-error-token = Token required. Configure token +offline.config-error-cloud = Cloud communication requires defined deviceId in the config