# Path: BAC0/core/io/IOExceptions.py
# class OutOfServiceNotSet(Exception):
#     """
#     This exception is used when trying to simulate a point and the out of service property is false.
#     """
# 
#     pass
# 
# class OutOfServiceSet(Exception):
#     """
#     This exception is used when trying to set the out of service property to
#     false to release the simulation...and it doesn't work.
#     """
# 
#     pass
# 
# class NoResponseFromController(Exception):
#     """
#     This exception is used when trying to read or write and there is not answer.
#     """
# 
#     pass
# 
# class ApplicationNotStarted(Exception):
#     """
#     Application not started, no communication available.
#     """
# 
#     pass


from .IOExceptions import (
    OutOfServiceNotSet,
    OutOfServiceSet,
    NoResponseFromController,
    ApplicationNotStarted,
)


            try:
                if self.read("{} {} {} outOfService".format(addr, obj_type, obj_inst)):
                    self.write(
                        "{} {} {} {} {}".format(
                            addr, obj_type, obj_inst, prop_id, value
                        )
                    )
                else:
                    raise OutOfServiceNotSet()
            except NoResponseFromController as e:
                self._log.warning(
                    "Failed to write to OutOfService property ({})".format(e)
                )

    def out_of_service(self, args):
        """
        Set the Out_Of_Service property so the Present_Value of an I/O may be written.

        :param args: String with <addr> <type> <inst> <prop> <value> [ <indx> ] [ <priority> ]

        """
        if not self._started:
            raise ApplicationNotStarted("BACnet stack not running - use startApp()")

        # with self.this_application._lock: if use lock...won't be able to call read...
        args = args.split()
        addr, obj_type, obj_inst = args[:3]
        try:
            self.write("{} {} {} outOfService True".format(addr, obj_type, obj_inst))

# Path: BAC0/core/io/IOExceptions.py
# class OutOfServiceNotSet(Exception):
#     """
#     This exception is used when trying to simulate a point and the out of service property is false.
#     """
# 
#     pass
# 
# class OutOfServiceSet(Exception):
#     """
#     This exception is used when trying to set the out of service property to
#     false to release the simulation...and it doesn't work.
#     """
# 
#     pass
# 
# class NoResponseFromController(Exception):
#     """
#     This exception is used when trying to read or write and there is not answer.
#     """
# 
#     pass
# 
# class ApplicationNotStarted(Exception):
#     """
#     Application not started, no communication available.
#     """
# 
#     pass


# Path: BAC0/core/io/Simulate.py
from .IOExceptions import (
    OutOfServiceNotSet,
    OutOfServiceSet,
    NoResponseFromController,
    ApplicationNotStarted,
)


            try:
                if self.read("{} {} {} outOfService".format(addr, obj_type, obj_inst)):
                    self.write(
                        "{} {} {} {} {}".format(
                            addr, obj_type, obj_inst, prop_id, value
                        )
                    )
                else:
                    raise OutOfServiceNotSet()
            except NoResponseFromController as e:
                self._log.warning(
                    "Failed to write to OutOfService property ({})".format(e)
                )

    def out_of_service(self, args):
        """
        Set the Out_Of_Service property so the Present_Value of an I/O may be written.

        :param args: String with <addr> <type> <inst> <prop> <value> [ <indx> ] [ <priority> ]

        """
        if not self._started:
            raise ApplicationNotStarted("BACnet stack not running - use startApp()")

        # with self.this_application._lock: if use lock...won't be able to call read...
        args = args.split()
        addr, obj_type, obj_inst = args[:3]
        try:
            self.write("{} {} {} outOfService True".format(addr, obj_type, obj_inst))

        except NoResponseFromController as e:
