# Enum ServiceType

java.lang.Object
java.lang.Enum<ServiceType>
com.codename1.home.ServiceType

All Implemented Interfaces:
  `Comparable<ServiceType>`

public enum ServiceType extends Enum<ServiceType>

What one `AccessoryService` is: HomeKit's `HMService` type, Matter's device type on an endpoint.

As with `AccessoryCategory`, this is for labelling rather than for deciding what to call. Ask `AccessoryService.supports(Trait)`.

- ## Enum Constant Summary

  Enum Constants
  Enum Constant
  Description
  `AIR_PURIFIER`
  An air purifier.
  `AIR_QUALITY_SENSOR`
  An air quality sensor.
  `BATTERY`
  A battery, reported as a service of its own so `Trait.BATTERY_LEVEL` and its siblings have somewhere to live.
  `CARBON_MONOXIDE_SENSOR`
  A carbon monoxide alarm.
  `CONTACT_SENSOR`
  A door or window contact sensor.
  `DOOR`
  A powered door.
  `FAN`
  A fan.
  `GARAGE_DOOR_OPENER`
  A garage door opener.
  `HUMIDITY_SENSOR`
  A humidity sensor.
  `LEAK_SENSOR`
  A water leak sensor.
  `LIGHT_SENSOR`
  An ambient light sensor.
  `LIGHTBULB`
  A dimmable or colour light.
  `LOCK_MECHANISM`
  A lock mechanism.
  `MOTION_SENSOR`
  A motion sensor.
  `OCCUPANCY_SENSOR`
  An occupancy sensor.
  `OTHER`
  Anything else, including a service type one platform has and this API does not.
  `OUTLET`
  A mains socket.
  `SMOKE_SENSOR`
  A smoke alarm.
  `SPEAKER`
  A speaker.
  `SWITCH`
  An on-off switch.
  `TEMPERATURE_SENSOR`
  A temperature sensor.
  `THERMOSTAT`
  A thermostat.
  `WINDOW_COVERING`
  A blind, shade or curtain.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static ServiceType`
  `valueOf(String name)`
  Returns the enum constant of this type with the specified name.
  `static ServiceType[]`
  `values()`
  Returns an array containing the constants of this enum type, in the order they are declared.

  ### Methods inherited from class Enum

  `clone, compareTo, equals, getDeclaringClass, getEnumValues, hashCode, name, ordinal, setEnumValues, toString, valueOf`

  ### Methods inherited from class Object

  `getClass, notify, notifyAll, wait, wait, wait`

- ## Enum Constant Details

  - ### LIGHTBULB

    public static final ServiceType LIGHTBULB
    A dimmable or colour light.

  - ### SWITCH

    public static final ServiceType SWITCH
    An on-off switch.

  - ### OUTLET

    public static final ServiceType OUTLET
    A mains socket.

  - ### THERMOSTAT

    public static final ServiceType THERMOSTAT
    A thermostat.

  - ### LOCK_MECHANISM

    public static final ServiceType LOCK_MECHANISM
    A lock mechanism.

  - ### DOOR

    public static final ServiceType DOOR
    A powered door.

  - ### GARAGE_DOOR_OPENER

    public static final ServiceType GARAGE_DOOR_OPENER
    A garage door opener.

  - ### WINDOW_COVERING

    public static final ServiceType WINDOW_COVERING
    A blind, shade or curtain.

  - ### FAN

    public static final ServiceType FAN
    A fan.

  - ### AIR_PURIFIER

    public static final ServiceType AIR_PURIFIER
    An air purifier.

  - ### MOTION_SENSOR

    public static final ServiceType MOTION_SENSOR
    A motion sensor.

  - ### OCCUPANCY_SENSOR

    public static final ServiceType OCCUPANCY_SENSOR
    An occupancy sensor. On Matter this and `MOTION_SENSOR` are the same device type; see `Trait.MOTION_DETECTED`.

  - ### CONTACT_SENSOR

    public static final ServiceType CONTACT_SENSOR
    A door or window contact sensor.

  - ### TEMPERATURE_SENSOR

    public static final ServiceType TEMPERATURE_SENSOR
    A temperature sensor.

  - ### HUMIDITY_SENSOR

    public static final ServiceType HUMIDITY_SENSOR
    A humidity sensor.

  - ### LIGHT_SENSOR

    public static final ServiceType LIGHT_SENSOR
    An ambient light sensor.

  - ### SMOKE_SENSOR

    public static final ServiceType SMOKE_SENSOR
    A smoke alarm.

  - ### CARBON_MONOXIDE_SENSOR

    public static final ServiceType CARBON_MONOXIDE_SENSOR
    A carbon monoxide alarm.

  - ### LEAK_SENSOR

    public static final ServiceType LEAK_SENSOR
    A water leak sensor.

  - ### AIR_QUALITY_SENSOR

    public static final ServiceType AIR_QUALITY_SENSOR
    An air quality sensor.

  - ### BATTERY

    public static final ServiceType BATTERY
    A battery, reported as a service of its own so `Trait.BATTERY_LEVEL` and its siblings have somewhere to live.

  - ### SPEAKER

    public static final ServiceType SPEAKER
    A speaker. See `Trait.VOLUME`.

  - ### OTHER

    public static final ServiceType OTHER
    Anything else, including a service type one platform has and this API does not.

- ## Method Details

  - ### values

    public static ServiceType[] values()
    Returns an array containing the constants of this enum type, in the order they are declared.
    Returns:
      an array containing the constants of this enum type, in the order they are declared

  - ### valueOf

    public static ServiceType valueOf(String name)
    Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
    Parameters:
      `name` - the name of the enum constant to be returned.
    Returns:
      the enum constant with the specified name
    Throws:
      `IllegalArgumentException` - if this enum type has no constant with the specified name
      `NullPointerException` - if the argument is null