1
0
mirror of https://github.com/home-assistant/core.git synced 2026-04-29 21:21:46 +01:00
Files
core/tests/components/shelly/fixtures/2pm_gen3.json
Maciej Bieniek 7f4cc99a3e Use sub-devices for Shelly multi-channel devices (#144100)
* Shelly RPC sub-devices

* Better varaible name

* Add get_rpc_device_info helper

* Revert channel name changes

* Use get_rpc_device_info

* Add get_rpc_device_info helper

* Use get_block_device_info

* Use helpers in the button platform

* Fix channel name and roller mode for block devices

* Fix EM3 gen1

* Fix channel name for RPC devices

* Revert test changes

* Fix/improve test_block_get_block_channel_name

* Fix test_get_rpc_channel_name_multiple_components

* Fix tests

* Fix tests

* Fix tests

* Use key instead of index to generate sub-device identifier

* Improve logic for Pro RGBWW PM

* Split channels for em1

* Better channel name

* Cleaning

* has_entity_name is True

* Add get_block_sub_device_name() function

* Improve block functions

* Add get_rpc_sub_device_name() function

* Remove _attr_name

* Remove name for button with device class

* Fix names of virtual components

* Better Input name

* Fix get_rpc_channel_name()

* Fix names for Inputs

* get_rpc_channel_name() improvement

* Better variable name

* Clean RPC functions

* Fix input_name type

* Fix test

* Fix entity_ids for Blu Trv

* Fix get_block_channel_name()

* Fix for Blu Trv, once again

* Revert name for reboot button

* Fix button tests

* Fix tests

* Fix coordinator tests

* Fix tests for cover platform

* Fix tests for event platform

* Fix entity_ids in init tests

* Fix get_block_channel_name() for lights

* Fix tests for light platform

* Fix test for logbook

* Update snapshots for number platform

* Fix tests for sensor platform

* Fix tests for switch platform

* Fix tests for utils

* Uncomment

* Fix tests for flood

* Fix Valve entity name

* Fix climate tests

* Fix test for diagnostics

* Fix tests for init

* Remove old snapshots

* Add tests for 2PM Gen3

* Add comment

* More tests

* Cleaning

* Clean fixtures

* Update tests

* Anonymize coordinates in fixtures

* Split Pro 3EM entities into sub-devices

* Make sub-device names more unique

* 3EM (gen1) does not support sub-devices

* Coverage

* Rename "device temperature" sensor to the "relay temperature"

* Update tests after rebase

* Support sub-devices for 3EM (gen1)

* Mark has-entity-name rule as done 🎉

* Rename `relay temperature` to `temperature`
2025-05-26 10:47:22 +02:00

260 lines
5.4 KiB
JSON

{
"config": {
"ble": {
"enable": true,
"rpc": {
"enable": true
}
},
"bthome": {},
"cloud": {
"enable": false,
"server": "iot.shelly.cloud:6012/jrpc"
},
"input:0": {
"enable": true,
"factory_reset": true,
"id": 0,
"invert": false,
"name": null,
"type": "switch"
},
"input:1": {
"enable": true,
"factory_reset": true,
"id": 1,
"invert": false,
"name": null,
"type": "switch"
},
"knx": {
"enable": false,
"ia": "15.15.255",
"routing": {
"addr": "224.0.23.12:3671"
}
},
"matter": {
"enable": false
},
"mqtt": {
"client_id": "shelly2pmg3-aabbccddeeff",
"enable": true,
"enable_control": true,
"enable_rpc": true,
"rpc_ntf": true,
"server": "mqtt.test.server",
"ssl_ca": null,
"status_ntf": true,
"topic_prefix": "shelly2pmg3-aabbccddeeff",
"use_client_cert": false,
"user": "iot"
},
"switch:0": {
"auto_off": false,
"auto_off_delay": 60.0,
"auto_on": false,
"auto_on_delay": 60.0,
"autorecover_voltage_errors": false,
"current_limit": 10.0,
"id": 0,
"in_locked": false,
"in_mode": "follow",
"initial_state": "match_input",
"name": null,
"power_limit": 2800,
"reverse": false,
"undervoltage_limit": 0,
"voltage_limit": 280
},
"switch:1": {
"auto_off": false,
"auto_off_delay": 60.0,
"auto_on": false,
"auto_on_delay": 60.0,
"autorecover_voltage_errors": false,
"current_limit": 10.0,
"id": 1,
"in_locked": false,
"in_mode": "follow",
"initial_state": "match_input",
"name": null,
"power_limit": 2800,
"reverse": false,
"undervoltage_limit": 0,
"voltage_limit": 280
},
"sys": {
"cfg_rev": 170,
"debug": {
"file_level": null,
"level": 2,
"mqtt": {
"enable": false
},
"udp": {
"addr": null
},
"websocket": {
"enable": true
}
},
"device": {
"addon_type": null,
"discoverable": true,
"eco_mode": true,
"fw_id": "20250508-110823/1.6.1-g8dbd358",
"mac": "AABBCCDDEEFF",
"name": "Test Name",
"profile": "switch"
},
"location": {
"lat": 15.2201,
"lon": 33.0121,
"tz": "Europe/Warsaw"
},
"rpc_udp": {
"dst_addr": null,
"listen_port": null
},
"sntp": {
"server": "sntp.test.server"
}
},
"wifi": {
"sta": {
"ssid": "Wifi-Network-Name",
"is_open": false,
"enable": true,
"ipv4mode": "dhcp",
"ip": null,
"netmask": null,
"gw": null,
"nameserver": null
}
},
"ws": {
"enable": false,
"server": null,
"ssl_ca": "ca.pem"
}
},
"shelly": {
"app": "S2PMG3",
"auth_domain": null,
"auth_en": false,
"fw_id": "20250508-110823/1.6.1-g8dbd358",
"gen": 3,
"id": "shelly2pmg3-aabbccddeeff",
"mac": "AABBCCDDEEFF",
"matter": false,
"model": "S3SW-002P16EU",
"name": "Test Name",
"profile": "switch",
"slot": 0,
"ver": "1.6.1"
},
"status": {
"ble": {},
"bthome": {},
"cloud": {
"connected": false
},
"input:0": {
"id": 0,
"state": false
},
"input:1": {
"id": 1,
"state": false
},
"knx": {},
"matter": {
"commissionable": false,
"num_fabrics": 0
},
"mqtt": {
"connected": true
},
"switch:0": {
"aenergy": {
"by_minute": [0.0, 0.0, 0.0],
"minute_ts": 1747488720,
"total": 0.0
},
"apower": 0.0,
"current": 0.0,
"freq": 50.0,
"id": 0,
"output": false,
"pf": 0.0,
"ret_aenergy": {
"by_minute": [0.0, 0.0, 0.0],
"minute_ts": 1747488720,
"total": 0.0
},
"source": "init",
"temperature": {
"tC": 40.6,
"tF": 105.1
},
"voltage": 216.2
},
"switch:1": {
"aenergy": {
"by_minute": [0.0, 0.0, 0.0],
"minute_ts": 1747488720,
"total": 0.0
},
"apower": 0.0,
"current": 0.0,
"freq": 50.0,
"id": 1,
"output": false,
"pf": 0.0,
"ret_aenergy": {
"by_minute": [0.0, 0.0, 0.0],
"minute_ts": 1747488720,
"total": 0.0
},
"source": "init",
"temperature": {
"tC": 40.6,
"tF": 105.1
},
"voltage": 216.3
},
"sys": {
"available_updates": {},
"btrelay_rev": 0,
"cfg_rev": 170,
"fs_free": 430080,
"fs_size": 917504,
"kvs_rev": 0,
"last_sync_ts": 1747488676,
"mac": "AABBCCDDEEFF",
"ram_free": 66440,
"ram_min_free": 49448,
"ram_size": 245788,
"reset_reason": 3,
"restart_required": false,
"schedule_rev": 22,
"time": "15:32",
"unixtime": 1747488776,
"uptime": 103,
"utc_offset": 7200,
"webhook_rev": 22
},
"wifi": {
"rssi": -52,
"ssid": "Wifi-Network-Name",
"sta_ip": "192.168.2.24",
"sta_ip6": [],
"status": "got ip"
},
"ws": {
"connected": false
}
}
}