@@ -447,9 +447,13 @@ async def test_device_tracker(
447447 """Test device tracker entity creation from GPS location."""
448448 victron_hub , mock_config_entry = init_integration
449449
450- # Inject GPS coordinates (latitude and longitude)
450+ # Inject all GPS metrics required by the gps_location formula
451451 await inject_message (victron_hub , "N/123/gps/0/Position/Latitude" , '{"value": 52.3676}' )
452452 await inject_message (victron_hub , "N/123/gps/0/Position/Longitude" , '{"value": 4.9041}' )
453+ await inject_message (victron_hub , "N/123/gps/0/Fix" , '{"value": 1}' )
454+ await inject_message (victron_hub , "N/123/gps/0/Altitude" , '{"value": 10.0}' )
455+ await inject_message (victron_hub , "N/123/gps/0/Course" , '{"value": 0.0}' )
456+ await inject_message (victron_hub , "N/123/gps/0/Speed" , '{"value": 0.0}' )
453457 await finalize_injection (victron_hub )
454458
455459 # Verify entity was created by checking entity registry
@@ -472,6 +476,10 @@ async def test_device_tracker_update(
472476
473477 await inject_message (victron_hub , "N/123/gps/0/Position/Latitude" , '{"value": 52.3676}' )
474478 await inject_message (victron_hub , "N/123/gps/0/Position/Longitude" , '{"value": 4.9041}' )
479+ await inject_message (victron_hub , "N/123/gps/0/Fix" , '{"value": 1}' )
480+ await inject_message (victron_hub , "N/123/gps/0/Altitude" , '{"value": 10.0}' )
481+ await inject_message (victron_hub , "N/123/gps/0/Course" , '{"value": 0.0}' )
482+ await inject_message (victron_hub , "N/123/gps/0/Speed" , '{"value": 0.0}' )
475483 await finalize_injection (victron_hub , disconnect = False )
476484 await hass .async_block_till_done ()
477485
0 commit comments