Legacy method for InfluxDB sensor?

Trying to refactor and modernize my Home Assistant configuration.

Would this be considered the legacy method for creating a sensor to read from an InfluxDB ?

sensor:
    # Docs: https://www.home-assistant.io/integrations/influxdb/#sensor
  - platform: influxdb
    host: a0d7b954-influxdb
    port: 8086
    database: homeassistant
    username: homeassistant
    password: !secret influxdb_homeassitant_pw
    # Docs: https://www.home-assistant.io/docs/configuration/platform_options/#scan-interval
    scan_interval: 60
    # Defined InfluxDB queries that will be executed and converted to HA sensors
    queries:
      - name: elec_wholehouse_kw
        unit_of_measurement: kw
        measurement: '"homeassistant"."autogen"."WholeHouse"'
        group_function: last
        field: value
        where: 'time < now()'
        value_template: "{{ (value | float / 1000) | float | round(2) }}"

If so, what would the modern format of this sensor be ?

Modern format?

It hasn’t changed.

It’s not a template sensor. It’s an influxdb sensor.

Example of legacy sensor (notice platform: template)-

sensor:
  - platform: template
    sensors:
      solar_angle:

You can check it in Legacy Sensor configuration format.

Thanks for the quick replies !! Ah ! I think I understand. The template “platform” used to be defined within the “sensor” integration (that’s the legacy format). Then it was broken out to be its own section of the configuration.yaml file.

I’m not suggesting a documentation change, just testing my understanding: Would it be accurate to rename this section of the docs from “Legacy Sensor configuration format” to “Legacy Template Sensor configuration format” ?

I think that’s what threw me off.

It’s already under the Template integration page. However, if you think it will help clearing confusions, you can contribute by submitting a PR here.

Your point is VERY valid. I was just pressure-testing my new understanding of the concept on “legacy format”. Thanks again for the help.