victronenergy / gui-v2

Other
24 stars 9 forks source link

Generalize the code for opening pages based on service type #1388

Open blammit opened 1 month ago

blammit commented 1 month ago

There are a number of places where gui-v2 pushes device-setting pages based on service type. For example:

Ideally these would be consolidated into some globally-accessible function, e.g. Global.openDeviceSettingsPage(serviceUid, properties) that could push the appropriate page based on the service type extrapolated from the uid, and pass the specified properties when creating/pushing the page.

blammit commented 1 month ago

The first step here is to ensure settings pages only require a serviceUid or bindPrefix, and do not require specific object types like Battery or VeBusDevice.

This is also relevant to https://github.com/victronenergy/gui-v2/issues/1137 as those pages use the explicit types to expose the main data for the page.